From: Niklas Laxström Date: Fri, 18 Sep 2009 13:57:13 +0000 (+0000) Subject: Shut up warnings from r56420 that have annoyed us few days :o X-Git-Tag: 1.31.0-rc.0~39648 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=c4a604a984f26bb2b044bf7d152bd7b9c535f97c;p=lhc%2Fweb%2Fwiklou.git Shut up warnings from r56420 that have annoyed us few days :o --- diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index c5abc23f2a..29a54c6f31 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -583,7 +583,18 @@ class LogEventsList { * @return Integer Number of total log items (not limited by $lim) */ public static function showLogExtract( &$out, $types=array(), $page='', $user='', - $param = array( 'lim' => 0, 'conds' => array(), 'showIfEmpty' => true, 'msgKey' => array('') ) ) { + $param = array() ) { + + $defaultParameters = array( + 'lim' => 0, + 'conds' => array(), + 'showIfEmpty' => true, + 'msgKey' => array('') + ); + + # The + operator appends elements of remaining keys from the right + # handed array to the left handed, whereas duplicated keys are NOT overwritten. + $param += $defaultParameters; global $wgUser, $wgOut; # Convert $param array to individual variables @@ -591,7 +602,7 @@ class LogEventsList { $conds = $param['conds']; $showIfEmpty = $param['showIfEmpty']; $msgKey = $param['msgKey']; - if ( !(is_array($msgKey)) ) + if ( !is_array($msgKey) ) $msgKey = array( $msgKey ); # Insert list of top 50 (or top $lim) items $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );